//
//  JYJMyTripViewController.m
//  JYJSlideMenuController
//
//  Created by JYJ on 2017/6/16.
//  Copyright © 2017年 baobeikeji. All rights reserved.
//

#import "JYJMyTripViewController.h"
#import "ProfileViewCell.h"
#import "UserSites.h"

@interface JYJMyTripViewController ()
@property (nonatomic,strong) UITableView* tableView;

@end

@implementation JYJMyTripViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self setupUI];
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tableView.frame = self.view.bounds;
}

-(void)setupUI{
    UITableView *tableView = [[UITableView alloc] init];
    tableView.scrollEnabled = NO;
    tableView.delegate = self;
    tableView.dataSource = self;
    tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    tableView.showsVerticalScrollIndicator = NO;
    tableView.backgroundColor = [UIColor clearColor];
    [self.view setBackgroundColor:XMColor(241, 245, 247)];
    [self.view addSubview:tableView];
    self.tableView = tableView;
}
#pragma mark - TableView DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // 创建cell
    ProfileViewCell *cell = [ProfileViewCell cellWithTableView:tableView];
    cell.backgroundColor=[UIColor whiteColor];
    //    cell.item = self.data[indexPath.row];
    UserSites* site=[UserSites mj_objectWithKeyValues:[UserInfo share].sites[0] ];
//    cell.siteName.text=site.siteName;
//    cell.phoneText.text=[UserInfo share].telephone;
    cell.siteName.text=@"热线电话";
    cell.phoneText.text=@"(+86)400 621 9606";
    [cell.phoneText setTextColor:[UIColor lightGrayColor]];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}
-(CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section{
    return 50;
}
-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section{
    UIView* v=[[UIView alloc] init];
    [v setBackgroundColor:XMColor(241, 245, 247)];
    
    return v;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    //    JYJCommenItem *item = self.data[indexPath.row];
    //    if (item.destVcClass == nil) return;
    //
    //    JYJPushBaseViewController *vc = [[item.destVcClass alloc] init];
    //    vc.title = item.title;
    //    vc.animateViewController = (JYJAnimateViewController *)self.parentViewController;
    //    [self.parentViewController.navigationController pushViewController:vc animated:YES];
}

@end
